package com.meaningful.thinking.proxy.jdk;

import java.lang.reflect.Proxy;

public class Main {

    public static void main(String[] args) {
        MyService myServiceDefault = new MyServiceDefaultImpl();
        MyService proxy = (MyService) Proxy.newProxyInstance(
                myServiceDefault.getClass().getClassLoader(),
                new Class[]{MyService.class},
                new MyEnhancer(myServiceDefault)
        );
        proxy.doSomething();
    }

}
